<template>
	<view class="content" v-if="incubatorsList!=''">
		<template v-if="type==1">
			<view class="title">
				基地情况简介
			</view>
			<view class="article">
				<view class="text">
					<mp-html :content="incubatorsList.introduce" />
				</view>
			</view>
		</template>
		<template v-if="type==2">
			<view class="title">
				基地管理办法
			</view>
			<view class="article">
				<view class="text">
					<mp-html :content="incubatorsList.regulations" />
				</view>
			</view>
		</template>
	</view>
	<view style="text-align: center;" v-else>暂无数据</view>
</template>

<script>
	import {
		getAreaBaseApi
	} from '@/api/incubation_base.js';
	export default {
		data() {
			return {
				incubatorsList: {
					regulations: '',
					introduce: ''
				},
				id: 1,
				type: 1
			}
		},
		methods: {
			navigate(url) {
				uni.navigateTo({
					url
				})
			},
			getAreaBase() {
				getAreaBaseApi({
					id: this.id
				}).then((res) => {
					this.incubatorsList = res ?? [];
				})
			},
		},
		onLoad(e) {
			console.log(99999999999)
			console.log(e)
			this.id = e.id;
			this.type = e.type
			this.getAreaBase()
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		padding: 30rpx;

		.title {
			font-size: 40rpx;
			font-weight: 900;
		}

		.data {
			margin-top: 30rpx;
			color: #888888;
			font-size: 30rpx;
		}


		.article {
			margin-top: 50rpx;

			.text {
				text-indent: 2em;
				font-size: 35rpx;
				line-height: 55rpx;
			}
		}

	}
</style>